<h3>Phone List for Team: <%= @team.name %></h3>

<table class="report-summary">
	<tr>
		<th>Team Member</th>
		<th>Job</th>
		<th>Phone</th>
	</tr>
	
<% if @team.distinct_members.empty? %>
<div id="message">
	This team has no one involved.
</div>
</table>

<% else %>

<% @team.distinct_members.sort_by {|p| p.last_first_name rescue nil}.each do |p| %>
	
	<tr>
		<td><%= p.full_name rescue nil %></td>
		<td><%= p.jobs_by_team(@team).sort_by(&:title).collect {|j| j.title}.to_sentence rescue nil %></td>
		<td><%= p.best_phone_smart rescue nil %></td>
	</tr>

<% end %>
	
</table>
<% end %>